﻿$(function(){
	
	log22=function(){
		
		var $id = $(".ids").text();
		var url = "/queryDetails?id="+$id;
		$.ajax({
			"url" : url,
			"type" : "get",
			"dataType" : "json",
			"success" : function(result) {
				if(result!=null){
					var imgi = "<img data-name='product_image' src='"+result.commodity_img+"' alt='' />";
					$(".thumbnails").append(imgi);
					$(".product-name").text(result.commodity_name);
					$(".mya").text(result.commodity_price);
					if(result.commodity_details.length>0){
						
						for (var i = 0; i < result.commodity_details.length; i++) {
							var img = "<img height='260px'width='280px' src='"+result.commodity_details[i].commoditydetails_img+"' />"; 
							$("#exTab5").append(img);
						}
					}
				}
				
			}
		})
	}
	
	$(".active").click(function(){
		window.location.href = "editcommodity_details?id="+$(".ids").text();
	})
	
	log22();
	
})